''' Mission 4 Obj. 1-7 with functions ''' from botcore import * from time import sleep delay = 0.1 n_led = 0 n_guests = 0 def flash_led(n_led): leds.user_num(n_led, True) sleep(delay) leds.user_num(n_led, False) def count_guests(n_guests): spkr.pitch(440) sleep(0.1) spkr.off() buttons.was_pressed(0) leds.ls_num(n_guests, True) while True: flash_led(n_led) n_led = n_led + 1 if n_led == 8: n_led = 0 if buttons.was_pressed(0): count_guests(n_guests) n_guests = n_guests + 1 if n_guests == 5: break